// ignore_for_file: prefer_function_declarations_over_variables, prefer_const_declarations, prefer_const_constructors

import 'package:favourcate/ui/pages/detail/detail.dart';
import 'package:favourcate/ui/pages/filter/filter.dart';
import 'package:favourcate/ui/pages/main/main.dart';
import 'package:favourcate/ui/pages/meal/meal.dart';
import 'package:flutter/material.dart';

class GLRouter {
  static final String initialRoute = GLMainScreen.routeName;

  static final Map<String, WidgetBuilder> routes = {
    GLMainScreen.routeName: (ctx) => GLMainScreen(),
    GLMealScreen.routeName: (ctx) => GLMealScreen(),
    GLDetailScreen.routeName: (ctx) => GLDetailScreen()
    // '/setting': (ctx) => GLErrorPage(),
  };


  static final RouteFactory generateRoute = (setting) {
    if (setting.name == GLFilterScreen.routeName) {
      return MaterialPageRoute(
        builder: (ctx) {
          return GLFilterScreen();
        },
        fullscreenDialog: true
      );
    }
  };

  static final  RouteFactory unknownRoute = (settings) {
    // return MaterialPageRoute(
    //   builder: (ctx) {
    //     return GLErrorPage();
    //   }
    // );
  };
}